export default function() {
  const route = { name: this.$route.name, path: this.$route.path, title: this.$route.meta.title }
  this.$store.dispatch('delVisitedViews', route).then(views => {
    const latestView = views.slice(-1)[0]
    if (latestView) {
      this.$router.push(latestView.path)
    } else {
      this.$router.push('/')
    }
  })
}
